/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Encoder;

/**
 *
 * @author Eric
 */
public class ArcadeDrive {
    
    static Talon leftdrive;
    static Talon rightdrive;
    static Encoder leftencoder;
    static Encoder rightencoder;
    static Joystick joy1;
    static Joystick joy2;
    
    public ArcadeDrive(int leftdrivetalon,int rightdrivetalon,int leftenc1,int leftenc2,int rightenc1,int rightenc2)
    {
        leftdrive = new Talon(leftdrivetalon);
        rightdrive = new Talon(rightdrivetalon);
        leftencoder = new Encoder(leftenc1,leftenc2);
        rightencoder = new Encoder(rightenc1,rightenc2);
        joy1 = new Joystick(1);
        joy2 = new Joystick(2);
    }
    
    public boolean driveStraight()
    {
        leftdrive.set(joy1.getY());
        rightdrive.set(-joy1.getY());
        
        return true;
    }
    
    public boolean driveWithTurning()
    {
        double lefttotal=0, righttotal=0;
        
        lefttotal = joy2.getX();
        righttotal = joy2.getX();
        
        lefttotal = lefttotal + joy1.getY();
        righttotal = righttotal + joy1.getY();
        
        righttotal = righttotal - (.1);
        
        leftdrive.set(lefttotal);
        rightdrive.set(-righttotal);
        
        return true;
    }
    
    
    
}
